The present invention relates to the improvement of object-oriented programming system that supports both object-oriented design and programming. The invention relates especially to the equivalent conversion of class network structure of a program.
Recently, object-oriented programming languages such as C++ have become popular as software development tools. In object-oriented programming, real world objects are represented by software entities called "objects" (also called "instances"); and states and behaviors of real world objects are defined as "attributes" and "operations" of "objects" respectively.
Object-oriented programming enables, on a software basis, real world information to be modeled, thus allowing simply-structured, easy-to-maintain software to be implemented.
In object-oriented programming, a program is composed of both classes and relationships among classes.
An object, described above, is created by a class as a result of program execution. During execution, actual values are assigned to the attributes of the object. This means that each class is a prototype of an object and that all objects which have the same attributes and operations are defined in a single class. In actual programming work, classes and relations among classes are described according to the specific grammar of a programming language.
The relationship among classes in object-oriented programming are typically inheritance, aggregation and association. "Inheritance" is a relationship which enables one class (a child class) to inherit the attributes and operations defined by another class (a parent class) without having to describe them again. This relationship, which is specified by a pre-defined format, defines the network structure of the whole program. When a parent class in an inheritance hierarchy has a certain relationship with a certain class, its child class is considered to have the same relationship with the certain class. This means that inheritance allows different structures which denote equal contents to be represented. Thus Inheritance lets the user omit the description of the definition, ensuring the child class has the same contents. On the other hand, when attributes or operations defined in a parent class change, child classes of this parent class inherit the changed attributes and operations, and the change affects not only to the parent class but also the child classes.
"Aggregation" is a relationship which allows one class (whole class) to include another class (part class) as its own part. This relationship, which is also specified in a pre-defined format, allows the user to develop programs incrementally and to use classes as if they were modules contained in a library.
"Association" is different from inheritance and aggregation. Association is a general relationship which denotes that there exists some communication between classes. Classes are linked by relationships to form a class network structure, and this structure, in turn, forms the whole program.
An existing object-oriented programming system supports the development of object-oriented programming. This system provides the user with various functionalities necessary for object-oriented programming; for example, it generates diagrams (charts) showing program elements and class network structures. With this system, the user can increase efficiency and reliability of object-oriented programming.
However, prior object-oriented programming systems do not provide the user with a means to modify class network structures (cancel and generate some relations) and each element of the class data (add and delete attributes, operations, and/or the class itself) while keeping the same information. Because of this, the prior systems have the following problems:
(1) First, when a change in one class affects other classes through class relationships, it is difficult to change a part of a program. For example, changing an attribute or an operation which is defined in a parent class and which is used by a child class through inheritance may affect the child class and, as a result, make the child class incomplete. Therefore, when changing a part of a program, the user must determine the range of the effect and take appropriate actions for that range manually. In addition, to prevent the change from affecting other classes, it is necessary to cancel the class relationship in advance. This requires the user to re-write relevant information of associated classes. This is tedious because it must be done manually. So, with a prior object-oriented programming system, it is difficult to change a part of a program quickly and accurately and to fully enhance the efficiency and reliability of program development.
(2) In addition, in the analysis stage of development where the definition range of each class and class network structure must be defined, the class network itself often must be changed. In this case, a change in a class network structure also involves manual operation and, as a result, delays processing.
(3) An inheritance relationship prevents the user from understanding all the attributes and operations of the child class, because some of them are defined in the parent class. A prior object-oriented programming system does not support distribution of these attributes and operations to each child class. It is difficult for users to do so accurately and speedily.
A change in a class network structure through class relationship cancellation or generation involves class network structure conversions such as class data transfer which loosens class relationships.